package com.shiro.test.mvc.controller;

import com.shiro.test.mvc.filter.MyShiroFilterFactoryBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by Administrator on 2020/11/23 0023.
 */
@Controller
public class PageController {

    @Autowired
    private MyShiroFilterFactoryBean shiroFilterFactoryBean;

    @RequestMapping("index.html")
    public String index(){
        return "index";
    }

    @RequestMapping("update.html")
    public String update(){
        shiroFilterFactoryBean.update();
        return "index";
    }
    @RequestMapping("error.html")
    public String error(){
        return "error";
    }

    @RequestMapping("do{path}.html")
    public String page(@PathVariable(name = "path") String path, Model model){
        model.addAttribute("path",path);
        return "test";
    }
}
